project(PANDA_APP_NATIVE_ENTRY)

add_library(calc_lib_native_entry SHARED calc_impl.cpp)
target_include_directories(calc_lib_native_entry PRIVATE ${ANI_INCLUDE_DIR})
target_include_directories(calc_lib_native_entry PRIVATE ${PANDA_HELPERS_SOURCE_DIR})

compile_panda_source(
    TARGET_NAME main_abc_native_entry
    SRC_FILE_NAME "main.ets"
)

add_custom_target(panda_app_native_entry_run
 COMMAND native_launcher
    --entry-class=main.Entry
    --entry-static-method=start
    --PandaOpt=--ext:--boot-panda-files=${ETSSTDLIB_ABC}:${CMAKE_CURRENT_BINARY_DIR}/main.abc
    --PandaOpt=--ext:--native-library-path=${PANDA_APP_NATIVE_ENTRY_BINARY_DIR}
 VERBATIM
 DEPENDS calc_lib_native_entry main_abc_native_entry
)
